home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kit PC World De Ampliacion De Windows 95
/
Kit PC World de ampliacion de Windows 95.iso
/
clarion
/
cw15
/
examp15.z
/
EDITPLAC.DOC
< prev
next >
Wrap
Text File
|
1995-09-08
|
3KB
|
65 lines
Edit in Place Documentation
---------------------------
This example is based on information found in help topics
and the Language Reference Manual. This example DOES NOT take
in consideration several situations such as duplicate keys,
network versions, etc.
When developing Edit in Place, you first go to the window
formatter. Select the list box and pull up the list box
properties dialog. Next you check off IMM and COLUMN. The
COLUMN attribute allows you to highlight a multi-column list
box, field by field. The IMM attribute specifies that
an event will be generated every time a user presses a key.
Now you create a local data field (we'll call it EditEntry)
and place it somewhere on the window. You then go into the
field properties dialog.Next you go into the position button
and check off hide. This control or field, EditEntry, is where
the edit in place occurs. By using the property, Prop:Edit,
this field will automatically unhide, resize and move to the
current highlighted record at runtime. Now that your window is
set up, it is time to code.
You would probably want to activate edit in place when your user
double clicks with their mouse. For this reason, you would
select the embedded source point called 'Browse Double
Click Handler' to enter code that will handle what happens.
Simply put, the code at this embed point does the following
things:*
1. Retrieves the highlighted record from the queue
2. Assign the key field the value of its corresponding current
queue element. This will allow us to set up the key field for
future use in retrieving the correct record for file maintenance.
3. Format the EditEntry control to have the same picture as the
current selected column.
4. Check which column is being used and write the contents of
the correct queue field to the EditEntry control.
5. Activate the edit in place.
Now that we put in code to allow them to edit in place, we
must now code for what happens after they type in their
corrections. In the accepted embedded source point, we do
the following:*
1. Retrieve the record from the file. (Remember that we set
this up in double click handling) **
2. Assign the queue fields to the file fields.
3. Write the changes to the file on disk.
4. Write the changes to the queue.
4. Turn off edit in place.
Hopefully, this example will give you some insight on Edit in
Place and a foundation to add it to your own program.
* The code for the steps are in the embedded source window
of the browse for your review.
** Assumption is that the records already exist in the file.
NOTE: In developing this example, I have encountered a bug
with the Prop:Edit property. This problem has been logged as 1816.
For further information, you can down load the bugs database.